package com.zcm.service;

import java.util.List;

import com.zcm.dao.UserDao;
import com.zcm.entity.address;
import com.zcm.entity.commodity;
import com.zcm.entity.favorite;
import com.zcm.entity.user;

public class UserService {
	private UserDao UserDao = new UserDao();
	
	public List<user> CheckUser(user user){
		return UserDao.CheckUser(user);
	}
	
	public int AddUser(user user){
		return UserDao.AddUser(user);
	}
	public int isExit(String username){
		return UserDao.isExit(username);
	}
	
	public List<address> SelectAddressByUserID(int userid){
		return UserDao.SelectAddressByUserID(userid);
	}
	public int AddAddress(address a) {
		return UserDao.AddAddress(a);
	}
	
	public List<commodity> SelevtAllFavorite(int userid){
		return UserDao. SelevtAllFavorite(userid);
	}
	
	public int AddFavorite(int userid , int comid) {
		return UserDao.AddFavorite(userid ,comid);
	}
	
	public int FavoriteIsExist(int comid, int userid) {
		return UserDao.FavoriteIsExist(comid,userid);
	}
	
	public int DeleteAddress(address ad) {
		return UserDao.DeleteAddress(ad);
	}
	
	public int UpdateAddress(address ad) {
		return UserDao.DeleteAddress(ad);
	}
	
	public int DeleteFavorite(int comid,int userid) {
		return UserDao.DeleteFavorite(comid,userid);
	}
	
	public user SelectAllByUserId(int userid) {
		return UserDao.SelectAllByUserId(userid);
	}
}
